﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Apriori
{
    class Itemset
    {
        /// <summary>
        /// Helper class. Gives us some specific output options for easy printing itemsets.
        /// Content-related.
        /// </summary>
        public List<Product> itemslist;

        public Itemset()
        {
            itemslist = new List<Product>();
        }

        public void Add(Product p)
        {
            this.itemslist.Add(p);
        }

        public string Print()
        {
            string itemset = "";
            foreach (Product p in itemslist)
            {
                itemset += "{ " + p.ToString() + " }";
            }
            return itemset;
        }

        public override string ToString()
        {
            return this.Print();
        }
    }
}
